#include "Projection.h"
#include <cmath>
#include "support.h"

Projection::Projection(void) : Filter(2, 1)
{
}


Projection::~Projection(void)
{
}

void Projection::Process()
{
	float Ax, Ay, Az;
	float *p = inputs[0]->ptr<float>(0);
	Ax = p[0];
	Ay = p[1];
	Az = p[2];

	float alpha, beta;
	p = inputs[1]->ptr<float>(0);
	alpha = p[0];
	beta = p[1];

	float Bx = Ax + Az * tan(alpha);
	float By = Ay + Az * tan(beta);

	outputs[0] = (cv::Mat_<float>(1,2) << Bx, By);
}
